﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

namespace IntelligentCMS
{
    public partial class CMSFrontPage : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {


            CMSDbDataLayer frontpage = new CMSDbDataLayer(ConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString, CMSDbDataHelper.Microsoft);
            frontpage.AddQuery("SELECT Content.[Template] FROM Content INNER JOIN Postable ON Content.[ID] = Postable.[FromID] WHERE Postable.[ToID] = " + postableid);
            frontpage.SelectQuery = true;
            frontpage.Execute();

            for (int i = 0; i < frontpage.Data.Rows.Count; i++)
            {

                
                //thePanel.Controls.Add(RenderControl(frontpage.Data.Rows[i]["Template"]));

            }


        }

        private long postableid = -1;


        public long PostableID
        {
            get
            {
                return postableid;
            }
            set
            {
                postableid = value;
            }

        }

    }
}